// 被拓展对象
const dependencies = {
  http: require("../lib/http"),
  file: require("./fileRw")
};
//拓展函数
function contextExtend(app, target) {
  let keys = Object.keys(target);
  keys.forEach(key => {
    app.context[key] = target[key];
  });
}

module.exports = function(app) {
  let targets = Object.keys(dependencies);
  targets.forEach(target => {
    contextExtend(app, target);
  });
};
